/**
 * Created by hulj on 2017/5/20.
 */
$(function () {
    var userId ='6224c881e2ec422691f7e631e8f5de17';

    /*用户账户*/
    $.ajax({
        type:"post",
        url:config.devUrl+"/account/quaryAccount.json",
        data:{'userId':userId},
        dataType:"json",
        success:function(data){
            var result = data.data;
            if(result.length > 0){
                for(var i=0;i<result.length;i++){
                    var account = result[i];
                    switch (account.accountType){
                        case 1: $("#benjing").text(account.amountNum); break;
                        case 3: $("#shouyi").text(account.amountNum); break;
                        case 4: $("#fencheng").text(account.amountNum); break;
                        case 5: $("#xiaofei").text(account.amountNum); break;
                        case 6: $("#xiaofeibi").text(account.amountNum); break;
                        default :
                            break;
                    }
                }
            }
        }
    });

    /*用户信息*/
    $.ajax({
        type:"get",
        url:config.devUrl+"/user/getUserInfo.json?id="+userId,
        dataType:"json",
        success:function(data){
            console.log(data)
            var html =  template('mine-message-temp', data);
            $("#mine-message").html(html);
        }
    });
});

